<template>
  <div>
    <p ref="count">{{ count }}</p>
    <button @click="handleClick">+1</button>
  </div>
</template>

<script>
export default {
  name: 'App',
  components: {},
  data() {
    return {
      count: 0,
    }
  },
  methods: {
    handleClick() {
      // 数据变化到视图更新这个过程是异步的
      this.count++
      // console.log(this.count)
      this.$nextTick(() => {
        console.log(this.$refs.count.innerHTML)
      })
    },
  },
}
</script>
